from django.db import models
from meiduo.utils.BaseModel import BaseModel

# Create your models here.


# QQ登录用户模型类
# 继承抽象模型类BaseModel，自动添加BaseModel定义的字段
class OAuthQQUser(BaseModel):
    """QQ登录用户数据"""

    # 创建user外键，关联对应的用户
    user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='用户')
    # 创建openid字段，存储QQ发布的用户身份id
    openid = models.CharField(max_length=64, db_index=True, verbose_name='openid')

    class Meta:
        db_table = 'tb_oauth_qq'
        verbose_name = 'QQ登录用户数据'
        verbose_name_plural = verbose_name
